how to print prime numbers in javascript